import logging

logging.basicConfig(level = logging.DEBUG,
                    format= '[(%(threadName)-8s):%(thread)d,%(relativeCreated)d] >> %(message)s',)


def get_logger( name, level = logging.DEBUG ):
    logger = logging.getLogger(name)
    logger.setLevel(level)
    return logger


def debug_print( msg ):
    print dir(__builtins__)
#    print globals()
#    if locals()['__debug'] == True:
    print dir()
    logging.debug(msg)